#include<iostream>
#include<cstring>
using namespace std;
char s[1000];
char s1[31];
int cnt ;
void chuli()
{
	cin.getline(s,sizeof(s));
	char *ss = s;
	for (int i=0;i<strlen(s);i++)
	{
		if (s[i]==' ' )
		{
			if ( (&s[i]-ss) > strlen(s1) )
				strncpy(s1,ss,&s[i]-ss);
			ss = &s[i]+1;
			cnt++;
		}
		else if (i==strlen(s)-1)
		{
			if ( (&s[i]-ss) > strlen(s1) )
				strcpy(s1,ss);
			cnt++;
		}		
	}
	cout << cnt << endl;
	cout << s1 ;
	return ;
}
int main()
{
	chuli();
	return 0;
}



